#!/anaconda3/envs/FEALPy/bin python3.8
# -*- coding: utf-8 -*-
# ---
# @Software: PyCharm
# @File: utils.py
# @Author: ---
# @Institution: --- University, ---, China
# @E-mail: ---@---.com, ---@---.edu.cn
# @Site: 
# @Time: 6月 24, 2024
# ---

import datetime
import random

def read_excel(file_path):
    """
    读取Excel文件，返回一个DataFrame
    :param file_path: Excel文件路径
    :return: DataFrame
    """
    import pandas as pd
    df = pd.read_excel(file_path)
    return df

def generate_serial_number():
    """
    生成流水号，格式为 TE+yyyyMMddHHmmssSSS+6位随机数
    :return: 流水号字符串
    """
    current_time = datetime.datetime.now().strftime('%Y%m%d%H%M%S%f')[:-3]
    random_number = ''.join([str(random.randint(0, 9)) for _ in range(6)])
    serial_number = f"TE+{current_time}+{random_number}"
    return serial_number
